From e02638f0dab8c0734060a63fbc58c1069f5daa03 Mon Sep 17 00:00:00 2001 From: robertlipe Date: Fri, 23 Aug 2013 03:05:37 +0000 Subject: [PATCH] Add a KML read test, lame as it is... --- gpsbabel/reference/kml-points.kml | 123 ++++++++++++++++++++++++++++++ gpsbabel/reference/kml-points.txt | 10 +++ gpsbabel/testo.d/kml-read.test | 8 ++ gpsbabel/text.cc | 6 -- 4 files changed, 141 insertions(+), 6 deletions(-) create mode 100644 gpsbabel/reference/kml-points.kml create mode 100644 gpsbabel/reference/kml-points.txt create mode 100644 gpsbabel/testo.d/kml-read.test diff --git a/gpsbabel/reference/kml-points.kml b/gpsbabel/reference/kml-points.kml new file mode 100644 index 000000000..fb5a08d3f --- /dev/null +++ b/gpsbabel/reference/kml-points.kml @@ -0,0 +1,123 @@ + + + + GPS device + Created Thu Aug 22 22:03:14 2013 + + -86.877408 + 36.042108 + 63537.698405 + + + + + + + + normal + #waypoint_n + + + highlight + #waypoint_h + + + + Waypoints + + GCEBB + + Cache Details]]> + #waypoint + + -87.134700,35.972033 + + + + GC1A37 + + Cache Details]]> + #waypoint + + -86.679550,36.090683 + + + + GC1C2B + + Cache Details]]> + #waypoint + + -86.620117,35.996267 + + + + GC25A9 + + Cache Details]]> + #waypoint + + -86.648617,36.038483 + + + + GC2723 + + Cache Details]]> + #waypoint + + -86.741767,36.112183 + + + + GC2B71 + + Cache Details]]> + #waypoint + + -86.790517,36.064083 + + + + GC309F + + Cache Details]]> + #waypoint + + -86.809733,36.087767 + + + + GC317A + + Cache Details]]> + #waypoint + + -86.892000,36.057500 + + + + GC317D + + Cache Details]]> + #waypoint + + -86.867283,36.082800 + + + + + diff --git a/gpsbabel/reference/kml-points.txt b/gpsbabel/reference/kml-points.txt new file mode 100644 index 000000000..71fca7807 --- /dev/null +++ b/gpsbabel/reference/kml-points.txt @@ -0,0 +1,10 @@ +No,Latitude,Longitude,Name,Description +1,35.972033,-87.134700,"GCEBB","Cache Details" +2,36.090683,-86.679550,"GC1A37","Cache Details" +3,35.996267,-86.620117,"GC1C2B","Cache Details" +4,36.038483,-86.648617,"GC25A9","Cache Details" +5,36.112183,-86.741767,"GC2723","Cache Details" +6,36.064083,-86.790517,"GC2B71","Cache Details" +7,36.087767,-86.809733,"GC309F","Cache Details" +8,36.057500,-86.892000,"GC317A","Cache Details" +9,36.082800,-86.867283,"GC317D","Cache Details" diff --git a/gpsbabel/testo.d/kml-read.test b/gpsbabel/testo.d/kml-read.test new file mode 100644 index 000000000..203002321 --- /dev/null +++ b/gpsbabel/testo.d/kml-read.test @@ -0,0 +1,8 @@ +# Test KML reader. +# Coverage here is lower than in our writer, but this is somewhat OK +# as real world usage shows our writer is more frequently used than our +# reader. + +# gpsbabel -i geo -f geocaching.loc -o unicsv -F ${TMPDIR}/geocaching.txt +gpsbabel -i kml -f ${REFERENCE}/kml-points.kml -o unicsv -F ${TMPDIR}/geo~unicsv.txt +compare ${REFERENCE}/kml-points.txt ${TMPDIR}/geo~unicsv.txt diff --git a/gpsbabel/text.cc b/gpsbabel/text.cc index bc25f334f..80f2910db 100644 --- a/gpsbabel/text.cc +++ b/gpsbabel/text.cc @@ -118,12 +118,6 @@ text_disp(const waypoint* wpt) GPS_Math_WGS84_To_UTM_EN(wpt->latitude, wpt->longitude, &utme, &utmn, &utmz, &utmzc); -#if 0 - if (tm == 0) { - tm = time(NULL); - } - strftime(tbuf, sizeof(tbuf), "%d-%b-%Y", localtime(&tm)); -#endif tmpout1 = pretty_deg_format(wpt->latitude, wpt->longitude, degformat[2], " ", 0); if (wpt->altitude != unknown_alt) { xasprintf(&altout, " alt:%d", (int)((altunits[0]=='f')?METERS_TO_FEET(wpt->altitude):wpt->altitude)); -- 2.30.2